package com.ruoyi.smartHighway.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
        import com.ruoyi.common.utils.DateUtils; //需要修改成自己的包名
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.smartHighway.mapper.VersionInfoMapper;
import com.ruoyi.smartHighway.domain.VersionInfo;
import com.ruoyi.smartHighway.service.IVersionInfoService;


/**
 * 版本更新记录Service业务层处理
 *
 * @author ljj
 * @date 2024-08-06
 */
@Service
public class VersionInfoServiceImpl extends ServiceImpl<VersionInfoMapper,VersionInfo> implements IVersionInfoService {

    @Autowired
    private VersionInfoMapper versionInfoMapper;

    /**
     * 查询版本更新记录
     *
     * @param versionId 版本更新记录主键
     * @return 版本更新记录
     */
    @Override
    public VersionInfo selectVersionInfoByVersionId(Long versionId) {
        return versionInfoMapper.selectVersionInfoByVersionId(versionId);
    }

    /**
     * 查询版本更新记录列表
     *
     * @param versionInfo 版本更新记录
     * @return 版本更新记录
     */
    @Override
    public List<VersionInfo> selectVersionInfoList(VersionInfo versionInfo) {
        return versionInfoMapper.selectVersionInfoList(versionInfo);
    }

    /**
     * 新增版本更新记录
     *
     * @param versionInfo 版本更新记录
     * @return 结果
     */
    @Override
    public int insertVersionInfo(VersionInfo versionInfo) {
                versionInfo.setCreateTime(DateUtils.getNowDate());
            return versionInfoMapper.insertVersionInfo(versionInfo);
    }

    /**
     * 修改版本更新记录
     *
     * @param versionInfo 版本更新记录
     * @return 结果
     */
    @Override
    public int updateVersionInfo(VersionInfo versionInfo) {
                versionInfo.setUpdateTime(DateUtils.getNowDate());
        return versionInfoMapper.updateVersionInfo(versionInfo);
    }

    /**
     * 批量删除版本更新记录
     *
     * @param versionIds 需要删除的版本更新记录主键
     * @return 结果
     */
    @Override
    public int deleteVersionInfoByVersionIds(Long[] versionIds) {
        return versionInfoMapper.deleteVersionInfoByVersionIds(versionIds);
    }

    /**
     * 删除版本更新记录信息
     *
     * @param versionId 版本更新记录主键
     * @return 结果
     */
    @Override
    public int deleteVersionInfoByVersionId(Long versionId) {
        return versionInfoMapper.deleteVersionInfoByVersionId(versionId);
    }
}

